import 'package:flutter/material.dart';

class NewRoute extends StatelessWidget{
  NewRoute({
    Key? key,
    required this.text,  // 接收一个text参数
  }) : super(key: key);
  final String text;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text("New route"),
        ),
        body: Center(
          child:TextButton(
              child: Text("This is new route \n $text",textAlign: TextAlign.center,),
              onPressed: () {
                Navigator.pop(context, "我是 NewRoute 返回值");
              }
          ),
        )
    );
  }
}